<template>
  <div class="tablewrap">
    <div>出险信息</div>
    <FilterTable :columns="columns" :dataSource="dataSource" :height="200" :onColumnsChange="columns => (this.columns = columns)" :isColumnFilter="false"></FilterTable>
  </div>
</template>

<script>
import moment from 'moment';
import { queryOccurInsuranceByLicenseOrVin } from '@/api/repair/business/customer/monitoring.js';
export default {
  name: 'ChuXianInfo',
  data() {
    return {
      // 出险信息
      dataSource: [],
      columns: this.createColumnsInsurance()
    };
  },
  mounted() {
    this.queryOccurInsuranceByLicenseOrVin();
  },
  methods: {
    async queryOccurInsuranceByLicenseOrVin() {
      // 需要参数
      const params = {
        sort: 'OCCUR_INSURANCE_NO',
        order: 'asc',
        limit: 10,
        offset: 0,
        LICENSE: '陕A2FU00',
        undefined: '10015',
        vin: '09876543219876543',
        ownerNo: 'OW1907110001',
        BRAND: 'LINCOLN',
        MILEAGE: 999999,
        isRepairOrder: 'REPAIR_ORDER_TAG',
        createDate: moment().format('YYYY-MM-DD HH-mm'),
        monitor_table: '',
        activity1_table: '',
        activity2_table: '',
        booking_table: '',
        insurance_table: '',
        warning_table: '',
        dmsFuncId: 35100010,
        _: moment().valueOf()
      };
      const res = await queryOccurInsuranceByLicenseOrVin(params);
      this.dataSource = res;
    },
    createColumnsInsurance() {
      return [
        {
          title: '序号'
        },
        {
          title: '出险单号',
          dataIndex: 'OCCUR_INSURANCE_NO'
        },
        {
          title: '报案人',
          dataIndex: 'REPORT_MAN'
        },
        {
          title: 'VIN',
          dataIndex: 'VIN'
        },
        {
          title: '车牌号',
          dataIndex: 'LICENSE'
        },
        {
          title: '品牌',
          dataIndex: 'BRAND'
        },
        {
          title: '车系',
          dataIndex: 'SERIES'
        },
        {
          title: '车型',
          dataIndex: 'MODEL'
        },
        {
          title: '客户来源',
          dataIndex: 'CUS_SOURCE'
        }
      ];
    }
  }
};
</script>

<style scoped></style>
